import 'package:get/get.dart';
import '../pages/permission/permission_view.dart';
import '../pages/permission/permission_logic.dart';
import '../pages/splash/splash_view.dart';
import '../pages/splash/splash_logic.dart';
import '../pages/home/home_view.dart';
import '../pages/home/home_logic.dart';
import '../pages/edit/edit_view.dart';
import '../pages/edit/edit_logic.dart';
import '../pages/version/version_view.dart';
import '../pages/version/version_logic.dart';


part 'app_routes.dart';

/// 应用页面配置 - App Pages Configuration
/// 定义所有页面路由和绑定
class AppPages {
  AppPages._();

  static const initial = Routes.permission;

  static final routes = [
    GetPage(
      name: _Paths.permission,
      page: () => const PermissionView(),
      binding: PermissionBinding(),
    ),
    GetPage(
      name: _Paths.splash,
      page: () => const SplashView(),
      binding: SplashBinding(),
    ),
    GetPage(
      name: _Paths.home,
      page: () => const HomeView(),
      binding: HomeBinding(),
    ),
    GetPage(
      name: _Paths.edit,
      page: () => const EditPage(),
      binding: EditBinding(),
    ),
    GetPage(
      name: _Paths.version,
      page: () => const VersionView(),
      binding: VersionBinding(),
    ),

    // TODO: 添加其他页面路由
    // GetPage(
    //   name: _Paths.detail,
    //   page: () => const DetailView(),
    //   binding: DetailBinding(),
    // ),
  ];
}

/// 主页绑定 - Home Binding
class HomeBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut<HomeLogic>(() => HomeLogic());
  }
}

/// 编辑页面绑定 - Edit Page Binding
class EditBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut<EditLogic>(() => EditLogic());
  }
}

/// 版本管理页面绑定 - Version Page Binding
class VersionBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut<VersionLogic>(() => VersionLogic());
  }
}



/// 权限授权页面绑定 - Permission Page Binding
class PermissionBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut<PermissionLogic>(() => PermissionLogic());
  }
}

/// 闪屏页面绑定 - Splash Page Binding
class SplashBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut<SplashLogic>(() => SplashLogic());
  }
}